package com.atguigu.gulimall.auth.feign;

import com.atguigu.common.to.member.SocialUserTo;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.auth.vo.UserLoginVo;
import com.atguigu.gulimall.auth.vo.UserRegisterVo;
import me.zhyd.oauth.model.AuthUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("gulimall-member")
public interface MemberFeignService {

    @PostMapping("/member/member/register")
    R register(@RequestBody UserRegisterVo vo);

    /**
     * 登录
     */
    @PostMapping("/member/member/login")
    // @RequiresPermissions("member:member:list")
    R login(@RequestBody UserLoginVo vo);


    /**
     * 社交账号(微博)登录
     */
    @PostMapping("/member/member/oauth2/weibo/login")
    // @RequiresPermissions("member:member:list")
    R oauth2WeiboWeiboLogin(@RequestBody SocialUserTo to);

    /**
     * 社交账号登录
     */
    @PostMapping("/member/member/oauth2/login")
    // @RequiresPermissions("member:member:list")
    R oauth2Login(@RequestBody AuthUser to);
}
